package consumer.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import consumer.entity.ConsEntity;
import consumer.service.ConsumerService;

@RestController
@RequestMapping("/consumer")
//雪花算法  异常设置
public class ConsumerController {
	@Autowired
	private ConsumerService consumerService;

	@PostMapping("/addcons")
	public ConsEntity addcons(@PathVariable("id") ConsEntity consEntity) {
		System.out.println(consEntity);
		return consumerService.addCons(consEntity);
	}
	
}
